package _b.chouxiang;

public class AnimalTest {
    public static void main(String[] args) {
//        Animal animal = new Animal("动物");
        Dog dog = new Dog("汪汪");
        Cat cat = new Cat("喵喵");

        //子类可重写父类方法
        dog.eat();
        cat.eat();

        //子类可继承父类方法
        dog.setName("阿拉斯加");
        dog.eat();
    }
}
